<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://www.jq22.com/jquery/jquery-3.3.1.js"></script>
</head>

<body>
    <style>
        @keyframes my {
            0% {
                width: 50px;
                height: 50px;
                top: 10px;
                right: 10px;
                background-color: blue;
            }
            25% {
                width: 100px;
                height: 100px;
                top: 10px;
                right: 10px;
                background-color: blue;
            }
            50% {
                width: 200px;
                height: 200px;
                top: 10px;
                right: 10px;
                background-color: blue;
            }
            75% {
                width: 300px;
                height: 300px;
                top: 10px;
                right: 10px;
                background-color: blue;
            }
            100% {
                width: 400px;
                height: 400px;
                top: 10px;
                right: 10px;
                background-color: blue;
            }
        }
    </style>
    <div class="my">

    </div>
    <script>
        let obj = {
            name: 'jack',
            age: 21,
            email: '123@QQ.COM'
        }
        let my = {
                ...obj
            }
            // 移除对象的某个属性
        delete obj.name
        console.log(obj)

        // 移除数据某个元素，但是会有数组中遗留下垃圾，移除位置为空
        // 遍历的时候会自动跳过,但长度是不变的
        let arr = [1, 2, 3, 4, 5]
        delete arr[2]
        console.log(arr)
        console.log(arr.length)


        obj.name = 'marry'
        console.log(my)


        // 判断两个数组对象里的所有值是否一样，主要解决数字字符串的问题
        // JSON.stringify 将字符串转换成json  如果顺序不同 会返回 false
        const t1 = [{
            name: '张三',
            age: 22.5,
            address: '上海市浦东新区'
        }]
        const t2 = [{
            name: '张三',
            age: '22.5',
            address: '上海市浦东新区'
        }]

        function ArrayToString(arr) {
            arr.forEach(item => {
                let property = Object.keys(item)
                property.forEach(p => {
                    item[p] = item[p] + ""
                })
            })
        }

        ArrayToString(t1)
        console.log(JSON.stringify(t1) === JSON.stringify(t2))
    </script>

</body>

</html>